package com.wy.powerbuilder.mapper.lwg;

import com.github.pagehelper.PageInfo;
import com.wy.powerbuilder.entity.lwg.owner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
//@Mapper
public interface ownerMapper {

    //删除
    @Delete("delete from owner where o_id=#{o_id}")
     public int delete(Integer o_id);

    //添加
    @Insert("INSERT INTO `owner` VALUES (NULL,#{o_number},#{o_name},#{o_state},#{o_phone},#{o_jdate},#{o_carder},#{o_ownership},#{o_before},#{o_remarks},#{o_zukedh},#{o_zukesfz},#{o_zukexb})")
    int  addUser(owner Owner);


    //修改
    @Update("UPDATE `owner` SET `o_number` = #{o_number}, `o_name` = #{o_name}, `o_state` = #{o_state}, `o_phone` = #{o_phone}, `o_jdate` = #{o_jdate}, `o_carder` = #{o_carder}, `o_ownership` = #{o_ownership}, `o_before` = #{o_before}, `o_remarks` = #{o_remarks}    WHERE `o_id` = #{o_id}")
    int updStudent(owner Owner);


    PageInfo<owner> selByPage(Integer pageNo, Integer pageSize);
    @Select("select * from owner where o_id = #{o_id}")
    owner selById(Integer id);
/*根据ID查询*/
    owner showUser(int o_id);
/*将数据查询到在修改*/
    Integer updaAdmin(owner Owner);
/*模糊查询*/
    List<owner> all(String o_state);


}
